package com.wj.auth.infrastrcture.mapper;

import com.wj.auth.vo.UserInfo;
import com.wj.auth.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper{

    @Select(" SELECT s_user.id, s_user.username, s_user.`password`, s_user.real_name AS realName, s_user.sex," +
            "  s_user.phone, s_user.id_card AS idCard, s_user.create_time AS createTime, s_user.create_user AS createUser, " +
            " s_user.update_time AS updateTime, s_user.update_user AS updateUser, s_user.deleted,s_user.status " +
            " FROM s_user" +
            " where s_user.deleted =0 and s_user.username=#{username}")
    UserVO getUserByUsername(@Param("username") String username);

    @Select(" SELECT s_user.id, s_user.username, s_user.real_name AS realName, s_user.sex," +
            "  s_user.phone, s_user.id_card AS idCard, s_user.create_time AS createTime, s_user.create_user AS createUser, " +
            " s_user.update_time AS updateTime, s_user.update_user AS updateUser,s_user.status " +
            " FROM s_user" +
            " where s_user.deleted =0 ")
    List<UserInfo> getUserList();
}